﻿using GalaSoft.MvvmLight;
using GalaSoft.MvvmLight.Messaging;

namespace WinAutomator.ViewModel
{
    /// <summary>
    /// This class contains properties that a View can data bind to.
    /// <para>
    /// See http://www.galasoft.ch/mvvm
    /// </para>
    /// </summary>
    public class TestViewModel : ViewModelBase
    {
        /// <summary>
        /// Initializes a new instance of the TestViewModel class.
        /// </summary>
        public TestViewModel()
        {
            
        }
        
        
        /// <summary>
        /// The <see cref="_myText" /> property's name.
        /// </summary>
        public const string MyTextPropertyName = "MyText";

        private string _mytest = "aaaaaaaaaa";

        /// <summary>
        /// Sets and gets the _myText property.
        /// Changes to that property's value raise the PropertyChanged event. 
        /// </summary>
        public string MyText
        {
            get
            {
                return _mytest;
            }

            set
            {
                if (_mytest == value)
                {
                    return;
                }
                _mytest = value;
                RaisePropertyChanged(MyTextPropertyName);

                Messenger.Default.Send(MyText, "Hello");
            }
        }


    }
}